﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RemoteController
{
    public class MovieMacroCommandGetter : MacroGetter
    {

        LivingroomLightOffCommand lightOff;
        LivingroomLightOnCommand lightOn;
        TVOffCommand tvOff;
        TVOnCommand tvOn;
        StereoOnCommand stereoOn;
        StereoOffCommand stereoOff;
        DVDOffCommand dvdOff;
        DVDOnCommand dvdOn;

        MacroCommand movieOnMacro;
        MacroCommand movieOffMacro;

        public Command[] commandsON;
        public Command[] commandsOFF;

        public MovieMacroCommandGetter(Light light, TV tv, Stereo stereo, DVD dvd)
        {
            lightOff = new LivingroomLightOffCommand(light);
            lightOn = new LivingroomLightOnCommand(light);
            tvOff = new TVOffCommand(tv);
            tvOn = new TVOnCommand(tv);
            stereoOn = new StereoOnCommand(stereo);
            stereoOff = new StereoOffCommand(stereo);
            dvdOff = new DVDOffCommand(dvd);
            dvdOn = new DVDOnCommand(dvd);

            commandsON = new Command[] { tvOn, stereoOn, dvdOn, lightOff };
            commandsOFF = new Command[] { tvOff, stereoOff, dvdOff, lightOn };

            movieOnMacro = new MacroCommand(commandsON);
            movieOffMacro = new MacroCommand(commandsOFF);
        }

        public virtual MacroCommand getOnMacro()
        {
            return movieOnMacro;
        }

        public virtual MacroCommand getOffMacro()
        {
            return movieOffMacro;
        }
    }
}
